rewriterule help
am 02.09.2009 12:02:45 von Andrew Hole
--0016e65aedc453f2990472955ee6
Content-Type: text/plain; charset=ISO-8859-1
Hi guys!
The following directive doesn't take into consideration the filename in URL:
RewriteCond %{DOCUMENT_ROOT}/bin/core/%1 -f
In this request the REQUEST_FILENAME has the value: /bin/adt/file.swf but I
just want the filename (file.swf).
How can I do that?
Thanks a lot
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}/bin/core/%1 -f
RewriteRule ^(.*)$ /core/$1 [L]
192.168.1.167 - - [02/Sep/2009:10:57:34 +0100]
[clappehr/sid#65c800][rid#87e078/initial] (2) init rewrite engine with
requested uri /bin/adt/file.swf
192.168.1.167 - - [02/Sep/2009:10:57:34 +0100]
[clappehr/sid#65c800][rid#87e078/initial] (3) applying pattern '^(.*)$' to
uri '/bin/adt/file.swf'
192.168.1.167 - - [02/Sep/2009:10:57:34 +0100]
[clappehr/sid#65c800][rid#87e078/initial] (4) RewriteCond:
input='/bin/adt/file.swf' pattern='!-f' => matched
192.168.1.167 - - [02/Sep/2009:10:57:34 +0100]
[clappehr/sid#65c800][rid#87e078/initial] (4) RewriteCond:
input='R:/EHR/client/pfh/bin/core/' pattern='-f' => not-matched
--0016e65aedc453f2990472955ee6
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hi guys!
The following directive doesn't take into consideration=
the filename in URL:
=A0 RewriteCond %{DOCUMENT_ROOT}/bin/core/%1 -f
>
In this request the REQUEST_FILENAME has the value: /bin/adt/file.swf =
but I just want the filename (file.swf).
How can I do that?
Thanks a lot
RewriteCond %{=
REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}/bin/core/%1 -f=
RewriteRule ^(.*)$ /core/$1 [L]
192.168.1.167 - - [02/Sep=
/2009:10:57:34 +0100] [clappehr/sid#65c800][rid#87e078/initial] (2) init re=
write engine with requested uri /bin/adt/file.swf
192.168.1.167 - - [02/Sep/2009:10:57:34 +0100] [clappehr/sid#65c800][rid#87=
e078/initial] (3) applying pattern '^(.*)$' to uri '/bin/adt/fi=
le.swf'
192.168.1.167 - - [02/Sep/2009:10:57:34 +0100] [clappehr/sid=
#65c800][rid#87e078/initial] (4) RewriteCond: input=3D'/bin/adt/file.sw=
f' pattern=3D'!-f' =3D> matched
192.168.1.167 - - [02/Sep/2009:10:57:34 +0100] [clappehr/sid#65c800][rid#87=
e078/initial] (4) RewriteCond: input=3D'R:/EHR/client/pfh/bin/core/'=
; pattern=3D'-f' =3D> not-matched
--0016e65aedc453f2990472955ee6--
Re: rewriterule help
am 02.09.2009 12:41:20 von Krist van Besien
On Wed, Sep 2, 2009 at 12:02 PM, Andrew Hole wr=
ote:
> Hi guys!
>
> The following directive doesn't take into consideration the filename in U=
RL:
> =A0 RewriteCond %{DOCUMENT_ROOT}/bin/core/%1 -f
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{DOCUMENT_ROOT}/bin/core/%1 -f
> RewriteRule ^(.*)$ /core/$1 [L]
>
> 192.168.1.167 - - [02/Sep/2009:10:57:34 +0100]
> [clappehr/sid#65c800][rid#87e078/initial] (2) init rewrite engine with
> requested uri /bin/adt/file.swf
> 192.168.1.167 - - [02/Sep/2009:10:57:34 +0100]
> [clappehr/sid#65c800][rid#87e078/initial] (3) applying pattern '^(.*)$' t=
o
> uri '/bin/adt/file.swf'
> 192.168.1.167 - - [02/Sep/2009:10:57:34 +0100]
> [clappehr/sid#65c800][rid#87e078/initial] (4) RewriteCond:
> input=3D'/bin/adt/file.swf' pattern=3D'!-f' =3D> matched
> 192.168.1.167 - - [02/Sep/2009:10:57:34 +0100]
> [clappehr/sid#65c800][rid#87e078/initial] (4) RewriteCond:
> input=3D'R:/EHR/client/pfh/bin/core/' pattern=3D'-f' =3D> not-matched
%1 is the result of any capture performed during the matching in the
RHS of y RewriteCond. If you use it in the LHS it will be empty, as
you can see in the logs. Which is why this doesn't work.
You can capture the filename in the RewriteRule, and use that.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}/bin/core/$2 -f
RewriteRule ^(.*)/(.*)$ /bin/core/$1/$2 [L]
(I haven't acutally testet this, but this should work...)
Krist
--=20
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: rewriterule help
am 02.09.2009 13:15:24 von Andrew Hole
--0016e6482b4425760d0472966297
Content-Type: text/plain; charset=ISO-8859-1
It works. However, i'm getting a popup with file save option and I would
like to see the page on Browser.
Thanks a lot
On Wed, Sep 2, 2009 at 11:41 AM, Krist van Besien
> wrote:
> On Wed, Sep 2, 2009 at 12:02 PM, Andrew Hole
> wrote:
> > Hi guys!
> >
> > The following directive doesn't take into consideration the filename in
> URL:
> > RewriteCond %{DOCUMENT_ROOT}/bin/core/%1 -f
>
>
>
> > RewriteCond %{REQUEST_FILENAME} !-f
> > RewriteCond %{DOCUMENT_ROOT}/bin/core/%1 -f
> > RewriteRule ^(.*)$ /core/$1 [L]
> >
> > 192.168.1.167 - - [02/Sep/2009:10:57:34 +0100]
> > [clappehr/sid#65c800][rid#87e078/initial] (2) init rewrite engine with
> > requested uri /bin/adt/file.swf
> > 192.168.1.167 - - [02/Sep/2009:10:57:34 +0100]
> > [clappehr/sid#65c800][rid#87e078/initial] (3) applying pattern '^(.*)$'
> to
> > uri '/bin/adt/file.swf'
> > 192.168.1.167 - - [02/Sep/2009:10:57:34 +0100]
> > [clappehr/sid#65c800][rid#87e078/initial] (4) RewriteCond:
> > input='/bin/adt/file.swf' pattern='!-f' => matched
> > 192.168.1.167 - - [02/Sep/2009:10:57:34 +0100]
> > [clappehr/sid#65c800][rid#87e078/initial] (4) RewriteCond:
> > input='R:/EHR/client/pfh/bin/core/' pattern='-f' => not-matched
>
> %1 is the result of any capture performed during the matching in the
> RHS of y RewriteCond. If you use it in the LHS it will be empty, as
> you can see in the logs. Which is why this doesn't work.
> You can capture the filename in the RewriteRule, and use that.
>
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{DOCUMENT_ROOT}/bin/core/$2 -f
> RewriteRule ^(.*)/(.*)$ /bin/core/$1/$2 [L]
>
> (I haven't acutally testet this, but this should work...)
>
> Krist
>
>
> --
> krist.vanbesien@gmail.com
> krist@vanbesien.org
> Bremgarten b. Bern, Switzerland
> --
> A: It reverses the normal flow of conversation.
> Q: What's wrong with top-posting?
> A: Top-posting.
> Q: What's the biggest scourge on plain text email discussions?
>
> ------------------------------------------------------------ ---------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
--0016e6482b4425760d0472966297
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
It works. However, i'm getting a popup with file save option and I woul=
d like to see the page on Browser.
Thanks a lot
"gmail_quote">On Wed, Sep 2, 2009 at 11:41 AM, Krist van Besien
=3D"ltr"><krist.vanbesien@g=
mail.com> wrote:
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
>On Wed, Sep 2, 2009 at 12:02 PM, Andrew Hole<
linglist@gmail.com">andremailinglist@gmail.com> wrote:
> Hi guys!
>
> The following directive doesn't take into consideration the filena=
me in URL:
> =A0 RewriteCond %{DOCUMENT_ROOT}/bin/core/%1 -f
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{DOCUMENT_ROOT}/bin/core/%1 -f
> RewriteRule ^(.*)$ /core/$1 [L]
>
> 192.168.1.167 - - [02/Sep/2009:10:57:34 +0100]
> [clappehr/sid#65c800][rid#87e078/initial] (2) init rewrite engine with=
> requested uri /bin/adt/file.swf
> 192.168.1.167 - - [02/Sep/2009:10:57:34 +0100]
> [clappehr/sid#65c800][rid#87e078/initial] (3) applying pattern '^(=
..*)$' to
> uri '/bin/adt/file.swf'
> 192.168.1.167 - - [02/Sep/2009:10:57:34 +0100]
> [clappehr/sid#65c800][rid#87e078/initial] (4) RewriteCond:
> input=3D'/bin/adt/file.swf' pattern=3D'!-f' =3D> ma=
tched
> 192.168.1.167 - - [02/Sep/2009:10:57:34 +0100]
> [clappehr/sid#65c800][rid#87e078/initial] (4) RewriteCond:
> input=3D'R:/EHR/client/pfh/bin/core/' pattern=3D'-f' =
=3D> not-matched
%1 is the result of any capture performed during the matching in the<=
br>
RHS of y RewriteCond. If you use it in the LHS it will be empty, as
you can see in the logs. Which is why this doesn't work.
You can capture the filename in the RewriteRule, and use that.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}/bin/core/$2 -f
RewriteRule ^(.*)/(.*)$ /bin/core/$1/$2 [L]
(I haven't acutally testet this, but this should work...)
Krist
--
<=
br>
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.<=
br>
See <URL:
lank">http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail:
g">users-unsubscribe@httpd.apache.org
=A0 " =A0 from the digest:
@httpd.apache.org">users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail:
org">users-help@httpd.apache.org
--0016e6482b4425760d0472966297--
Re: rewriterule help
am 02.09.2009 15:34:47 von Krist van Besien
On Wed, Sep 2, 2009 at 1:15 PM, Andrew Hole wrote:
> It works. However, i'm getting a popup with file save option and I would
> like to see the page on Browser.
That is probably due to an incorrect content type header. Have a look
at what the server sends with an appropriate tool (Firebug or
HTTPHeaders for Firefox for example...)
Krist
--
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org